package org.framework.define.mapper.support;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.framework.define.bean.entity.TblUserBizAccount;
import org.framework.define.mapper.AbstractObjectRowMapper;
import org.framework.server.util.UserUtil;

public class BidderRowMapper extends AbstractObjectRowMapper<TblUserBizAccount> {

	public BidderRowMapper() {
		super(TblUserBizAccount.class);
	}

	@Override
	protected void mapRowHandler(ResultSet rs, TblUserBizAccount entity) {
		try {
			if(hasColumn("credit"))
				entity.setLevel(UserUtil.countLevel(rs.getInt("credit")));
			if(hasColumn("address"))
				entity.setAddress(rs.getString("address"));
			if(hasColumn("black_count"))
				entity.setBlackCount(rs.getInt("black_count"));
			if(hasColumn("qq_num"))
				entity.setQqNum(rs.getString("qq_num"));
			if(hasColumn("user_type"))
				entity.setUserType(rs.getInt("user_type"));
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}


}
